<script>
// #ifdef APP-PLUS
import { update } from './utils/update-package.js'
import addListenerPush from '@/utils/unipush.js'; // 推送监听 
// #endif
export default {
	onLaunch: function() {
    // #ifdef APP-PLUS
		 //启动图停留时间 设置2.4秒后主动关闭，最多设置6秒
		setTimeout(() => {
		  plus.navigator.closeSplashscreen();
		}, 2000);
    update() // 检查更新
    console.log('执行了升级更新', plus.runtime.appid)
    addListenerPush() // 监听消息推送
    // #endif
    
    // #ifdef APP-PLUS
    // nvue页面设置引用iconfont图标
    const dom = weex.requireModule('dom');
    dom.addRule('fontFace', {
      fontFamily: 'iconfont',
      src: "url('/static/icons/iconfont.ttf')"
    })
    // #endif
	},
	onShow: function() {
    if (uni.getStorageSync('Ztc_B_USER_INFO')) {
      let userInfo = uni.getStorageSync('Ztc_B_USER_INFO')
      this.$store.commit('setUserInfo', userInfo)
      this.$store.commit('user/setUserInfo', userInfo)
    }
    if (uni.getStorageSync('userInfoDetail')) {
      let userInfoDetail = uni.getStorageSync('userInfoDetail')
      this.$store.commit('setUserInfoDetail', userInfoDetail)
    }
	},
	onHide: function() {
		// console.log('App Hide');
	},
  methods: {

  }

};
</script>

<style lang="scss">
	/* #ifndef APP-PLUS-NVUE */
	@import "uview-ui/index.scss";
	
	@import url("/static/icons/iconfont.css");
	@import url("/static/icons/iconfont-multi-icon.css");
	
	@import "./static/css/style.scss";
	@import "./static/css/uview-ui.scss";
	
  page {
    height: 100%;
  }
	/* #endif */

/* 解决头条小程序组件内引入字体不生效的问题 */
/* #ifdef MP-TOUTIAO */
@font-face {
	font-family: uniicons;
	src: url('/static/uni.ttf');
}
/* #endif */

/* #ifndef APP-PLUS-NVUE */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
	margin-top: 8rpx;
}


// 黄底黑字圆角大按钮
.btn-primary {
	background: linear-gradient(-90deg, #FBD321, #FFE23E);
	color: #343434;
  font-size: 32rpx;
	//border-color: #FBD321;
	border-radius: 44rpx;
	width: 650rpx;
	height: 88rpx;
  line-height: 88rpx;
}
// 灰底黑字圆角大按钮
.btn-disable {
	background-color: #eee;
	color: #343434;
	border-color: #eee;
	border-radius: 44rpx;
	width: 650rpx;
	height: 88rpx;
  //line-height: 88rpx;
}

.button-hover {
  opacity: 0.7;
}
//状态栏
.status_bar {
		height: var(--status-bar-height);
		width: 100%;
		background-color: #fff;
}
.status_bar_title {
	text-align: center;
	font-size: 36rpx;
	color: #333333;
	font-weight: bold;
	height: 44rpx;
	line-height: 44rpx;
}

/* #endif */
</style>
